﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using Common.Library;
using System.Reflection;

namespace OnlineVideos.Views
{
    public class settingclass
    {
          public string SettingName
        {
            get;
            set;
        }
        public string SettingValue
        {
            get;
            set;
        }
    }
    public partial class MusicSettings : PhoneApplicationPage
    {
        List<settingclass> settingclasslist = new List<settingclass>();
        public MusicSettings()
        {
            InitializeComponent();
            Loaded += MusicSettings_Loaded;
        }

        void MusicSettings_Loaded(object sender, RoutedEventArgs e)
        {
           Assembly DataAssembly = Assembly.Load(new AssemblyName("Common.Library"));
           Type ClassType = DataAssembly.GetType("Common.Library" + "." + "AppResources");
           PropertyInfo[] ConditionProperty = ClassType.GetProperties().ToArray();
           foreach (PropertyInfo property in ConditionProperty)
           {
               settingclass settingclass = new settingclass();
               if (property.PropertyType != typeof(Uri))
               {
                   settingclass.SettingName = property.Name.ToString() + " : ";
                   settingclass.SettingValue = (property.GetValue(property) != null ? property.GetValue(property).ToString() : null);
                   if (settingclass.SettingValue != null)
                       settingclasslist.Add(settingclass);
               }
           }
           lbxsettings.ItemsSource = settingclasslist;
        }
    }
}